package com.summer.Collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class ConllectionsTest {
    public static void main(String[] args) {
        //Conllections 工具类操作Collection Map
        List list =  new ArrayList();
        list.add(123);
        list.add(45);
        list.add(-1);
        list.add(99);
        System.out.println(list);
//        Collections.reverse(list);
//        System.out.println(list);
//        Collections.shuffle(list);
//        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);
        System.out.println(Collections.frequency(list, 123));
        List dest = Arrays.asList(new Object[list.size()]);
        Collections.copy(dest,list);
        System.out.println(dest);
        List list1 = Collections.synchronizedList(list);//转换成线程安全的

    }


}
